# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=umockdev
pkgver=0.17.13
pkgrel=0
pkgdesc="Mock hardware devices for creating unit tests and bug reporting"
arch="all"
url="https://github.com/martinpitt/umockdev"
license="LGPL-2.1-or-later"
makedepends="eudev-dev gtk-doc meson vala libpcap-dev gobject-introspection-dev"
checkdepends="gphoto2 libgudev-dev py3-gobject3 usbutils xz"
if [ "$CARCH" != "ppc64le" ]; then
	checkdepends="$checkdepends evtest"
fi
options="!check" # fail on builders for some reason, works on CI and locally (and for upstream)
source="https://github.com/martinpitt/umockdev/archive/$pkgver/umockdev-$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"

build() {
	abuild-meson \
		-Dgtk_doc=true \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
2d546c7e9bed3e8a7097e242ac0a8c2098022603203f5b9a04836110e83e4fa495c1d69542b234db636b639ec3838803b3afae84eb506737bbf6c87e3df2d9e8  umockdev-0.17.13.tar.gz
"
